package com.alpha.eceasy.mall.controller;

import com.alpha.eceasy.core.R;
import com.alpha.eceasy.mall.client.CommunicationRecordDTO;
import com.alpha.eceasy.mall.service.DemandContactCommunicationRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/demandContactCommunicationRecord")
@Deprecated
@Tag(description = "demandContactCommunicationRecord", name = "沟通内容接口")
public class DemandContactCommunicationRecordController {
    @Resource
    private DemandContactCommunicationRecordService demandContactCommunicationRecordService;

    @GetMapping("/briefInfo")
    @Operation(description = "获取沟通内容", summary = "获取沟通内容")
    public R getBriefInfo(String demandContactGuid) {
        return demandContactCommunicationRecordService.getBriefInfo(demandContactGuid);
    }

    /**
     * 分页查询
     *
     * @return 单条数据
     */
    @GetMapping("/page")
    @Operation(description = "获取沟通内容", summary = "获取沟通内容")
    public R pageList(@RequestParam(value = "orderAliasId", required = false) String orderAliasId) {
        return this.demandContactCommunicationRecordService.pageList(orderAliasId);
    }

    /**
     * 新增数据
     *
     * @param requestVo 实体对象
     * @return 新增结果
     */
    @PostMapping("/add")
    @Operation(description = "添加沟通内容", summary = "添加沟通内容")
    public R insert(@RequestBody CommunicationRecordDTO requestVo) {
        return this.demandContactCommunicationRecordService.create(requestVo);
    }

}
